Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Fixed broadcast group: cut failed links on partial sending success #2966

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Jun 26, 2024

(TRIAL FIX #2959)

This changes the following:

  1. In case when sending failed over several links, waiting for unblocking any socket is done only if:
    • in blocking mode
    • no socket has succeeded
  2. If at least one link succeeded, but there are any failed, failed links are immediately set closed.

@maxsharabayko
Copy link
Collaborator

Seems ok except for those spurious read-ready events on the receiver side. But that's probably another story.

.\bin\Debug\srt-xtransmit.exe receive srt://:4200?groupconnect=1 -v --enable-metrics
10:20:39.732274 [I] SOCKET::SRT srt://:4200: bound to ':4200'.
10:20:39.734158 [D] SOCKET::SRT @925860786 (srt://:4200) Listening
10:20:39.734545 [D] SOCKET::SRT @925860786 (srt://:4200) ASYNC Waiting for incoming connection
10:21:17.811396 [D] SOCKET::SRT @925860786 (srt://:4200) 1 ready, [0]: 0x372F83B2
10:21:17.812261 [E] SOCKET::SRT Failed to get sockopt SRTO_PBKEYLEN.
10:21:17.812594 [E] SOCKET::SRT Failed to get sockopt SRTO_KMSTATE.
10:21:17.812835 [I] SOCKET::SRT @925860786 (srt://:4200) Accepted connection @1999602608. TSBPD Latency RCV 120ms, peer 0ms. KM state INVALID (RCV UNSECURED, SND UNSECURED). PB key length: -1. Cryptomode . Stream ID: not set.
10:21:17.813983 [I] RECEIVE Latency, us: avg n/a, min n/a, max n/a. Jitter: 0us. Delay Factor: 1us. Pkts: rcvd 0, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:18.828574 [I] RECEIVE Latency, us: avg n/a, min n/a, max n/a. Jitter: 0us. Delay Factor: 1us. Pkts: rcvd 0, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:19.816634 [I] RECEIVE Latency, us: avg n/a, min n/a, max n/a. Jitter: 0us. Delay Factor: 1us. Pkts: rcvd 0, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:20.829061 [I] RECEIVE Latency, us: avg n/a, min n/a, max n/a. Jitter: 0us. Delay Factor: 1us. Pkts: rcvd 0, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:21.822977 [I] RECEIVE Latency, us: avg n/a, min n/a, max n/a. Jitter: 0us. Delay Factor: 1us. Pkts: rcvd 0, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:22.820212 [I] RECEIVE Latency, us: avg n/a, min n/a, max n/a. Jitter: 0us. Delay Factor: 1us. Pkts: rcvd 0, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:23.823979 [I] RECEIVE Latency, us: avg n/a, min n/a, max n/a. Jitter: 0us. Delay Factor: 1us. Pkts: rcvd 0, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:24.815954 [I] RECEIVE Latency, us: avg 6006706, min 6000395, max 6045259. Jitter: 258us. Delay Factor: 44863us. Pkts: rcvd 4682, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:25.822615 [I] RECEIVE Latency, us: avg 6000625, min 6000392, max 6037859. Jitter: 16us. Delay Factor: 37468us. Pkts: rcvd 9462, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:26.816404 [I] RECEIVE Latency, us: avg 6001145, min 6000385, max 6040801. Jitter: 18us. Delay Factor: 40414us. Pkts: rcvd 14211, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:27.830086 [I] RECEIVE Latency, us: avg 6005729, min 6000553, max 6029325. Jitter: 69us. Delay Factor: 28772us. Pkts: rcvd 16384, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:28.822305 [I] RECEIVE Latency, us: avg 6005729, min n/a, max n/a. Jitter: 69us. Delay Factor: 1us. Pkts: rcvd 16384, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:29.825920 [I] RECEIVE Latency, us: avg 6005729, min n/a, max n/a. Jitter: 69us. Delay Factor: 1us. Pkts: rcvd 16384, reordered 0 (dist 0), lost 0, MD5 err 0, bad len 0.
10:21:29.872775 [W] [METRICS] Detected loss of 1 packets (seqno [16384; 16385))
10:21:29.910663 [T] SOCKET::SRT recvmsg error 6002: try again (spurious read-ready)
10:21:29.911362 [D] RECEIVE sock::read() returned 0 bytes (spurious read ready?). Retrying.
...
10:21:32.154375 [T] SOCKET::SRT recvmsg error 6002: try again (spurious read-ready)
10:21:32.154744 [D] RECEIVE sock::read() returned 0 bytes (spurious read ready?). Retrying.
10:21:32.155000/T20216*E:SRT.gr: grp/recv: $1999602608: ABANDONING: opened=false connected=false
10:21:32.155728 [D] SOCKET::SRT @1999602608 read::recv ERROR 2002 Connection does not exist
10:21:32.156090 [W] RECEIVE read::recv: Connection does not exist
10:21:32.819594 [D] SOCKET::SRT @1999602608 Releasing epolls before closing
10:21:32.820582 [D] SOCKET::SRT @1999602608 Closing
10:21:32.821167 [D] SOCKET::SRT @925860786 Releasing epolls before closing
10:21:32.821597 [D] SOCKET::SRT @925860786 Closing
srt-xtransmit generate "srt://127.0.0.1:4200?grouptype=broadcast&latency=6000" srt://127.0.0.1:4200 --sendrate 50Mbps -v --enable-metrics --duration 10s

10:21:17.805486 [T] SOCKET::SRT_GROUP Creating a group of callers (type broadcast).
10:21:17.807184 [D] SOCKET::SRT_GROUP @1371969989 SYNC Connecting group to remote SRT
10:21:17.807560 [D] SOCKET::SRT_GROUP srt_connect_group
10:21:17.812131 [E] SOCKET::SRT Failed to get sockopt SRTO_PBKEYLEN.
10:21:17.812388 [E] SOCKET::SRT Failed to get sockopt SRTO_KMSTATE.
10:21:17.812629 [D] SOCKET::SRT_GROUP @1371969989 SYNC Group member connected to remote. TSBPD off. KM state INVALID (RCV UNSECURED, SND UNSECURED). PB key length: -1. Cryptomode . Stream ID: not set.
10:21:17.812837 [I] PACER sendrate 50000000 bps (inter send interval 210 us)
10:21:18.813068 [I] GENERATE Sending at 49292 kbps
10:21:19.813062 [I] GENERATE Sending at 49902 kbps
10:21:20.813628 [I] GENERATE Sending at 50418 kbps
10:21:23.865177 [I] GENERATE Sending at 7494 kbps
10:21:24.865174 [I] GENERATE Sending at 51239 kbps
10:21:25.865933 [I] GENERATE Sending at 48312 kbps
10:21:26.865922 [I] GENERATE Sending at 51724 kbps
10:21:29.903925 [I] GENERATE Sending at 6986 kbps
10:21:29.904982 [D] SOCKET::SRT_GROUP @1371969989 Closing SRT group

@maxsharabayko maxsharabayko added this to the v1.5.4 milestone Jun 27, 2024
@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Jun 27, 2024
@ethouris ethouris marked this pull request as ready for review June 27, 2024 13:10
@ethouris
Copy link
Collaborator Author

I would apply the changes from #2527 on the receiver side and see if it still holds.

@maxsharabayko maxsharabayko merged commit 5e6e80b into Haivision:master Jul 2, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Broadcast sending logic does not handle the lack of SND buffer space correctly.
2 participants